﻿@model DHQGHN.PM2.Models.SurveyMethodInfoModel
@*<script src="~/Scripts/armchart.js" type="text/javascript"></script>
<script src="~/Scripts/pie.js" type="text/javascript"></script>
<script src="~/Scripts/light.js" type="text/javascript"></script>*@

<script type="text/javascript">
    var model = '@Html.Raw(Json.Encode(Model))';
    var obj = JSON.parse(model);
    //alert(JSON.stringify(obj));
    var data = {
        "type": "pie",
        //"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
        "titleField": "country",
        "valueField": "litres",
        "fontSize": 12,
        "theme": "light",
        "allLabels": [],
        "balloon": {},
        "titles": [],
        "dataProvider": [
            {
                "country": "ĐT Online",
                "litres": obj.Online
            },
            {
                "country": "ĐT Tablet",
                "litres": obj.Tablet
            },
            {
                "country": "ĐT Giấy",
                "litres": obj.Page
            }
        ]
    };
    AmCharts.makeChart("chartdiv", data);
   // alert(JSON.stringify((data)));
</script>
<div class="row">   
    <div id="chartdiv" style="width: 100%; height: 400px; background-color: #FFFFFF;"></div>
    @*<div class="col-md-6" style="margin-top:10px;">
        
    </div>*@
</div>